﻿<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>


    <style>
        .el-icon-caret-right {
            display: none !important;
        }

        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }
    </style>
</head>

<body>

    <div id="app" v-cloak>
        <el-select @visible-change="visibleChange" v-model="value" placeholder="请选择">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
        </el-select>
        <el-row>
            <el-col :span="24">
                <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                    style="margin-bottom: 15px;">
                    <el-row>
                        <el-col class="head-tool">

                            <div class="new_title fl"><strong><img src="/static/images/icon1.png" />测试页列表</strong></div>
                            <span>
                                <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3"
                                    @click="onSubmit"></btn>
                                <btn :text="col.btnAdd" linetype="3" @click="UserInput('tj')"></btn>
                                <btn-export-list url="xxxx" :forminline="this.formInline" linetype="3">
                                </btn-export-list>
                                <btn-uploadfile-list url="xxxx" linetype="3"></btn-uploadfile-list>
                                <btn :text="col.btnDownLoad" linetype="3" @click="onDelete"></btn>
                                <btn :text="col.btnDelete" linetype="4" @click="onDelete"></btn>
                            </span>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{user.sex+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.sex" slot="suffix" :placeholder="user.sex">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in sex" :label="item.value" :value="item.key">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input v-model="formInline.model.loginName" :placeholder="user.loginName"
                                        size="mini">
                                        <template slot="prepend">
                                            {{user.loginName+mark.m}}
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{user.sex+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.sex" slot="suffix" :placeholder="user.sex">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in sex" :label="item.value" :value="item.key">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input v-model="formInline.model.loginName" :placeholder="user.loginName"
                                        size="mini">
                                        <template slot="prepend">
                                            {{user.loginName+mark.m}}
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                            <div class="elst-select-mini" size="mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{user.sex+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.sex" slot="suffix" :placeholder="user.sex">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in sex" :label="item.value" :value="item.key">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input v-model="formInline.model.loginName" :placeholder="user.loginName"
                                        size="mini">
                                        <template slot="prepend">
                                            {{user.loginName+mark.m}}
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                    </el-row>
                </el-form>
                <el-col :span="4">
                    <div class="tree_lay">
                        <h4 class="title clearfix"><strong>测试页导航</strong></h4>
                        <el-tree :data="data5" show-checkbox node-key="id" ref="tree" highlight-current
                            @node-click="handleNodeClick">
                            <span slot-scope="scope">
                                <span>
                                    <i :class="scope.data.icon"></i>
                                    <template>
                                        <span v-if="scope.data.icon == 'tree-open'"
                                            style="color:#12489e">{{ scope.node.label }}</span>
                                        <span v-else-if="scope.data.icon == 'tree-close'"
                                            style="color: #12489e">{{ scope.node.label }}</span>
                                        <span v-else>{{ scope.node.label }}</span>
                                    </template>
                                </span>
                            </span>
                        </el-tree>
                    </div>
                </el-col>
                <el-col :span="20">
                    <el-table ref="table" stripe :data="ListItem.tableData" :row-key="getRowKeys"
                        :height="ListItem.tableHeight" border @selection-change="handleSelectionChange"
                        row-style="height:10px" style="width: 100%;">
                        <el-table-column type="selection" style="
    padding-top: 0px;
    padding-bottom: 0px;
" width="55" :reserve-selection="true">
                        </el-table-column>
                        <el-table-column prop="lastUpdate" :label="user.lastUpdate" width="110">
                        </el-table-column>
                        <el-table-column prop="loginName" :label="user.loginName" width="100">
                        </el-table-column>
                        <el-table-column prop="sex" :label="user.sex" width="100">
                        </el-table-column>
                        <el-table-column prop="remarks" :label="user.remarks" align="left">
                        </el-table-column>
                        <el-table-column width="53" prop="update" :label="col.btnUpdate" fixed="right">
                            <template slot-scope="scope">
                                <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)>
                                    <i class="el-icon-edit"></i>
                                </button>
                            </template>
                        </el-table-column>
                    </el-table>
                    <el-row type="flex" justify="end">
                        <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                            :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes"
                            :page-size="ListItem.pagesize" :layout="ListItem.layout" :total="ListItem.total">
                        </el-pagination>
                    </el-row>
                </el-col>
                <el-dialog title="用户信息管理" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%"
                    height="80%" top="10vh" fullscreen="true">
                    <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%"
                        frameborder="0"></iframe>
                </el-dialog>
            </el-col>
        </el-row>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                options: [{
                    value: '选项1',
                    label: '黄金糕'
                }, {
                    value: '选项2',
                    label: '双皮奶'
                }, {
                    value: '选项3',
                    label: '蚵仔煎'
                }, {
                    value: '选项4',
                    label: '龙须面'
                }, {
                    value: '选项5',
                    label: '北京烤鸭'
                }],
                value: '',
                data5: [{
                    id: 1,
                    label: '一级 1',
                    icon: 'tree-open',
                    children: [{
                        id: 2,
                        label: '二级 1-1',
                        icon: 'tree-open',
                        children: [{
                            id: 3,
                            label: '三级 1-1-1',
                            icon: 'tree-item',
                        }, {
                            id: 4,
                            label: '三级 1-1-2',
                            icon: 'tree-item',
                        }]
                    }]
                }, {
                    id: 5,
                    label: '一级 2',
                    icon: 'tree-open',
                    children: [{
                        id: 6,
                        label: '二级 2-1',
                        icon: 'tree-item',
                    }, {
                        id: 7,
                        label: '二级 2-2',
                        icon: 'tree-item',
                    }]
                }, {
                    id: 8,
                    label: '一级 3',
                    icon: 'tree-open',
                    children: [{
                        id: 9,
                        label: '二级 3-1',
                        icon: 'tree-item',
                    }, {
                        id: 10,
                        label: '二级 3-2',
                        icon: 'tree-item',
                    }]
                }],
                //表单内容
                ListItem: ListItem,
                //获取下拉菜单sex
                sex: [],
                formInline: {
                    model: { loginName: '', sex: '' },
                    offset: 0,
                    limit: 10
                }
            },
            created: function () {

            },
            mounted: function () {

                console.log(getDicDataArray(["01", "02", "03", "04"]))

                //获取下拉菜单内容
                this.sex = getDicData('01');


                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
            },
            methods: {
                getCheckedKeys() {
                    console.log(this.$refs.tree.getCheckedKeys());
                },
                setCheckedKeys() {
                    this.$refs.tree.setCheckedKeys([3]);
                },
                resetChecked() {
                    this.$refs.tree.setCheckedKeys([]);
                },
                handleNodeClick: function (data) {

                    if (!data.children) {
                        // this.formInline.model.TreeNode = data.id
                        // onSubmit(this);
                        this.$refs.tree.setCheckedKeys([]);
                        this.$refs.tree.setCheckedKeys([data.id]);
                        console.log(this.$refs.tree.getCheckedKeys());
                    } else {
                        this.$refs.tree.setCheckedKeys([]);
                        this.$refs.tree.setCheckedKeys([data.id]);
                        console.log(this.$refs.tree.getCheckedKeys());
                        if (data.icon == "tree-open") {
                            data.icon = "tree-close"
                        } else (
                            data.icon = "tree-open"
                        )
                    }
                },
                //关闭Dialog 回调
                closeDialog: function () { closeDialog(this); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/User/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Dialog展示
                UserInput: function (val, id) { DialogShow(this, val, "demo5.17input.html", id); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/User/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                //获取下拉菜单数据
                getDropDown: function () {
                },
            }
        });

    </script>

</body>

</html>